<include file="public@header" />
<link href="__STATIC__/multiDatesPicker/jquery-ui.css" rel="stylesheet"/>
<link href="__STATIC__/multiDatesPicker/jquery-ui.multidatespicker.css" rel="stylesheet"/>
</head>
<body>
	<div class="wrap">
		<form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('sign_up/timetable')}">
			<div class="form-group">
				<label class="col-sm-2 control-label">
					<span class="form-required">*</span>上课日期
				</label>
				<div class="checkbox-inline">
					<label class="">
						<textarea class="form-control" style="height:270px;width: 250px;" name="dates" readonly>{:implode(',',$dates_arr)}</textarea>
					</label>
				</div>
				<div class="checkbox-inline">
					<div id="multiDates"></div>
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<input type="hidden" name="sign_up_id" value="{:input('id')}">
					<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
				</div>
			</div>
		</form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
	<script src="__STATIC__/multiDatesPicker/jquery.min.js"></script>
	<script src="__STATIC__/multiDatesPicker/jquery-ui.min.js"></script>
	<script src="__STATIC__/multiDatesPicker/jquery-ui.multidatespicker.js"></script>
	<script type="text/javascript">
	jQuery('#multiDates').multiDatesPicker({
	    // 配置选项
	    dateFormat: 'yy-mm-dd',
	    <if !empty($dates_arr)>
	    addDates: {$dates_json},
	    </if>
	    // 设置为中文
                multiDatesSeparator: '，',
                beforeShowDay: $.multiDatesPicker.beforeShowDay,
	    onSelect: function(dateText, inst) {
	        // 用户点击日期后的操作
	        var selectedDates = $(this).multiDatesPicker('getDates');
	        $('textarea[name=dates]').val(selectedDates)
	        console.log(selectedDates);
	    }
	});
	</script>
</body>
</html>